odhcp6c: clear the socket buffer after initialising it
There is a chance that the socket receives packets it should not
process between its initial creation and when ra_init is finished.
Flush these from the buffer by calling recvmsg and throwing away
everything that is received.
This solves a race condition on a multi-interface device, where
several odhcp6c instances are started, and an RA for one interface
ends up in the queue for another interface's odhcp6c socket.
Signed-off-by: Lincoln Ramsay <[email protected]>
Link: https://github.com/openwrt/odhcp6c/pull/133
Signed-off-by: Álvaro Fernández Rojas <[email protected]>